<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  	<head>
        <title>P2P Fusion - Peerscape</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta name="generator" content="Peerscape" />
        <meta http-equiv="imagetoolbar" content="no" />

        <style type="text/css">
            <!-- 
            @import url(/static/css/core.css);
            @import url(/static/css/content.css);
            -->
        </style>
        <link rel="shortcut icon" type="image/x-icon" href="http://p2p-fusion.org/favicon.ico" />
    </head>
  	<body class="admin">
	    <div id="wrapper">
	        <div id="inner">
                <div id="topLinks">
                    <h5 class="hide">Personal tools</h5>
                    <ul>
                        <li>
                            <a id="admin" href="http://admin.hexlabel.net/">My Admin</a>
                        </li>
                        <li>
                            <a id="user" href="http://my.hexlabel.net/">My Profile</a>
                        </li>
                    </ul>
                    <div class="clr"><br/></div>
                </div>

                <div id="main">
                    <div class="inner" style="border: 2px solid ${safety_color}">
                        <div id="header">
                            <div class="left">
                                <h1 id="logo"><a href="http://my.hexlabel.net/" accesskey="1">fusion</a></h1>
                                <h2 id="subtitle">Peerscape</h2>
                            </div>
                            <div class="right">
                                <div id="globalTools">
                                    <h5 class="hide">Global tools</h5>
                                    <ul class="contextTools">
                                        <li>
                                            <a href="http://admin.hexlabel.net/">Admin Home</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/invite_person/">Invite a friend</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/invite_group_list/">Invite someone to join a group</a>
                                        </li>
                                        <li class="selected">
                                            <a href="http://admin.hexlabel.net/invitations/">Invitations &amp; Memberships</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/personal_code/">Create login</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="clr"><br/></div>
                        </div>

                        <div id="content">
                            <div id="info">
                                <h2>
                                    Invitations &amp; Memberships
                                    <span class="inlineNav">
                                        <a href="#pending">Pending invitations</a>
                                        <a href="#friends">Friends</a>
                                        <a href="#groups">Groups</a>
                                    </span>
                                </h2>
                                % if errors:
                                    <div class="alert">${message}</div>
                                % elif message:
                                    <div class="message">${message}</div>
                                % endif

                                <div class="intro">
                                    <p>If you have received an invitation code, enter it in the box below.</p>
                                    <p>Or <a href="/invite/">click here to invite a friend</a></p>
                                </div>
                                <form id="invitecodeForm" method="GET" action="http://admin.hexlabel.net/invitations/">
                                    <input type="hidden" name="do" value="entercode"/>
                                    <dl class="single">
                                        <dt><label for="invitecode">Invitation code</label></dt>
                                        <dd>
                                            <input type="text" class="text" name="invitecode" id="invitecode" value="${invitecode}"/>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dd class="buttons">
                                            <input type="submit" class="submit default" value="Submit"/>
                                        </dd>
                                        <dd class="buttons cancel">
                                            <a href="http://admin.hexlabel.net/" class="button">Cancel</a>
                                        </dd>
                                    </dl>
                                    <div class="clr"><br/></div>
                                </form>
                            </div>

                            <div class="section" id="pending">
                                <h3>
                                    Pending invitations
                                    <span class="inlineNav">
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if errors_pending:
                                    <div class="alert">${message_pending}</div>
                                % elif message_pending:
                                    <div class="message">${message_pending}</div>
                                % endif
                                % if invitations and len(invitations) > 0:
                                    <ul class="listForm">
                                        % for iid, item in invitations.items():
                                            <li>
                                                <form method="POST" action="http://admin.hexlabel.net/invitations/#pending" class="listForm">
                                                    <input type="hidden" name="do" value="decide"/>
                                                    <input type="hidden" name="invitation_iid" value="${iid}"/>
                                                    <dl>
                                                        <dd>
                                                            <a href="http://${iid}.hexlabel.net/">
                                                                <img src="${item['picture']}" alt="${item['name']}" class="thumbnail"/>
                                                            </a>
                                                            <a href="http://${iid}.hexlabel.net/">
                                                                ${item['name']}
                                                            </a>
                                                        </dd>

                                                        <dd class="buttons">
                                                            <input type="submit" class="submit" name="invitation_decline" value="Decline"/>
                                                            <input type="submit" class="submit default" name="invitation_accept" value="Accept"/>
                                                        </dd>
                                                    </dl>
                                                    <div class="clr"><br/></div>
                                                </form>
                                            </li>
                                        % endfor
                                    </ul>
                                % else:
                                    <ul>
                                        <li>No pending invitations</li>
                                    </ul>
                                % endif
                            </div>


                            <div class="section" id="friends">
                                <h3>
                                    Friends (${len(friend_list['index'])})
                                    <span class="inlineNav">
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if errors_friends:
                                    <div class="alert">${message_friends}</div>
                                % elif message_friends:
                                    <div class="message">${message_friends}</div>
                                % endif
                                % if len(friend_list['index']) > 0:
                                    <ul class="listForm">
                                        % for iid in friend_list['index']:
                                            <li>
                                                <form method="POST" action="http://admin.hexlabel.net/invitations/#friends" class="listForm">
                                                    <input type="hidden" name="do" value="revoke_friend"/>
                                                    <input type="hidden" name="iid" value="${iid}"/>
                                                    <dl>
                                                        <dd>
                                                            <a href="http://${iid}.hexlabel.net/">
                                                                <img src="${friend_list['items'][iid]['picture']}" alt="${friend_list['items'][iid]['name']}" class="thumbnail"/>
                                                            </a>
                                                            <a href="http://${iid}.hexlabel.net/">
                                                                ${friend_list['items'][iid]['name']}
                                                            </a>
                                                        </dd>

                                                        <dd class="buttons">
                                                            <input type="submit" class="submit" name="decision" value="Revoke"/>
                                                        </dd>
                                                    </dl>
                                                    <div class="clr"><br/></div>
                                                </form>
                                            </li>
                                        % endfor
                                    </ul>
                                % else:
                                    <ul>
                                        <li>No friends</li>
                                    </ul>
                                % endif
                                <div class="clr"><br/></div>
                            </div>


                            <div class="section" id="groups">
                                <h3>
                                    Groups (${len(group_list['index'])})
                                    <span class="inlineNav">
                                        <a href="#wrapper">^ Top</a>
                                    </span>
                                </h3>
                                % if errors_groups:
                                    <div class="alert">${message_groups}</div>
                                % elif message_groups:
                                    <div class="message">${message_groups}</div>
                                % endif
                                % if len(group_list['index']) > 0:
                                    <ul class="listForm">
                                        % for iid in group_list['index']:
                                            <li>
                                                <form method="POST" action="http://admin.hexlabel.net/invitations/#groups" class="listForm">
                                                    <input type="hidden" name="do" value="revoke_group"/>
                                                    <input type="hidden" name="iid" value="${iid}"/>
                                                    <dl>
                                                        <dd>
                                                            <a href="http://${iid}.hexlabel.net/">
                                                                <img src="${group_list['items'][iid]['picture']}" alt="${group_list['items'][iid]['name']}" class="thumbnail"/>
                                                            </a>
                                                            <a href="http://${iid}.hexlabel.net/">${group_list['items'][iid]['name']}</a>
                                                        </dd>

                                                        <dd class="buttons">
                                                            % if group_list['items'][iid]['is_admin']:
                                                                <a href="http://admin.hexlabel.net/manage_group/?iid=${iid}" class="button">Manage</a>
                                                            % endif
                                                            <input type="submit" class="submit" value="Resign"/>
                                                        </dd>
                                                    </dl>
                                                    <div class="clr"><br/></div>
                                                </form>
                                            </li>
                                        % endfor
                                    </ul>
                                % else:
                                    <ul>
                                        <li>No groups.</li>
                                    </ul>
                                % endif
                            </div>

                        </div>
                    </div>
                </div>
    
                <div id="footer">
                    <div class="left">
                        <ul>
                            <li><a class="footer" href="http://p2p-fusion.org">Home</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/contact">Contact us</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/disclaimer">Disclaimer</a></li>
                        </ul>
                    </div>
                    <div class="right">
                        <p class="footerText">P2P-FUSION is co-funded by the European Union through the IST programme under FP6.</p>
                    </div>
                    <div class="clr"><br/></div>
                </div>
            </div>
	    </div>
	</body>
</html>


